/*
 * @Description: web端新闻管理
 */
const NewsService = require("../../services/web/NewsService")

const NewsController = {
  getList: async (req, res) => {
    const id = req.params.id
    const result = await NewsService.getList(id)
    res.send({
      code: 200,
      data: result,
      msg: '数据获取成功',
    })
  },
  // 根据传入参数可能获取不同条数新闻
  getTopList: async (req, res) => {
    const result = await NewsService.getTopList({limit:req.query.limit})
    res.send({
      code: 200,
      data: result,
      msg: '数据获取成功',
    })
  },
}
module.exports = NewsController
